import java.io.*;	
public class ThrowsDemo{	
static double c;	
public static  void main(String []args){
BufferedReader readin=new BufferedReader(new InputStreamReader(System.in));
	   try{
	           System.out.println("һ() ");	
	           String  input1=readin.readLine();       // IOException
	           float a=Float.parseFloat(input1);        // NumberFormatException
	           System.out.println("һĳ ");
String  input2=readin.readLine();       // IOException	
	           float b=Float.parseFloat(input2);       // NumberFormatException
	           c=division(a,b);	
	   }catch(IOException ioe){
	           System.out.println("ϵͳ ");
	           System.out.println(ioe.getMessage());
	           System.out.println("޷ж ");
	           System.exit(0);
	   }catch(NumberFormatException nfe){
System.out.println("ֵ ");
	           System.out.println(nfe.getMessage());
	           System.out.println("޷ж ");		
	           System.exit(0);
	   }catch(ArithmeticException ae){
	            System.out.println(ae.getMessage());
	            System.exit(0);
	   }finally{
	            System.out.println("Ľ "+'\n'+c);
	             System.exit(0);
	   }
}
static double division(double x, double y)throws ArithmeticException{
if(y==0) throw new ArithmeticException("Ϊ0,޴ ");
	           double result;
	   result=x/y;
	   return result;
}
}
